<?php
class Logger_Common
{
    public static function log($message, $level = Zend_Log::INFO)
    {
        $configuration = Zend_Registry::get('config');
        if (!  ( $configuration->logger && $configuration->logger->enabled)  ) return ;


        $writer = null;

        try {
            $writer = Zend_Registry::get('default_logger_common');
        }
        catch(Exception $e)
        {
            $logFileWriter = new Zend_Log_Writer_Stream($configuration->logger->file);
            $writer = new Zend_Log($logFileWriter);
        }

        $writer->log($message, $level);
    }
}